namespace OneWorks.Utils.FluentData
{
    using System;
    using System.Linq.Expressions;

    internal class DeleteBuilder<T> : BaseDeleteBuilder, IDeleteBuilder<T>
    {
        public DeleteBuilder(IDbCommand command, string tableName, T item)
            : base(command, tableName)
        {
            this.Data.Item = item;
        }
        public IDeleteBuilder<T> Where(Expression<Func<T, object>> expression, DataTypes parameterType, int size)
        {
            this.Actions.ColumnValueAction(expression, parameterType, size);
            return this;
        }

        public IDeleteBuilder<T> Where(string columnName, object value, DataTypes parameterType, int size)
        {
            this.Actions.ColumnValueAction(columnName, value, parameterType, size);
            return this;
        }
    }

    internal class DeleteBuilder : BaseDeleteBuilder, IDeleteBuilder
    {
        public DeleteBuilder(IDbCommand command, string tableName)
            : base(command, tableName)
        {
        }

        public IDeleteBuilder Where(string columnName, object value, DataTypes parameterType, int size)
        {
            this.Actions.ColumnValueAction(columnName, value, parameterType, size);
            return this;
        }
    }
}